package vip.xiaonuo.supplier.modular.business.businessdetail.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import vip.xiaonuo.common.pojo.CommonEntity;
import vip.xiaonuo.supplier.modular.base.productions.entity.SupplierProductions;
import vip.xiaonuo.supplier.modular.business.businessMain.entity.SupplierBusinessMain;
import vip.xiaonuo.supplier.modular.warehouse.storages.entity.SupplierStorages;
import vip.xiaonuo.supplier.modular.warehouse.storeslocation.entity.SupplierStoresLocation;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 业务明细表实体
 *
 * @author Mr.wu
 * @date  2025/03/26 11:23
 **/
@Getter
@Setter
@TableName("SUPPLIER_BUSINESS_DETAIL")
public class SupplierBusinessDetail extends CommonEntity {

    /** 业务明细ID */
    @TableId
    @Schema(description = "业务明细ID")
    private String id;

    /** 主业务ID */
    @Schema(description = "主业务ID")
    @Trans(type = TransType.SIMPLE, target = SupplierBusinessMain.class, fields = "businessCode", alias = "inventory", ref = "detailBusinessIdName")
    private String detailBusinessId;

     /**主业务ID名称 */
    @Schema(description = "主业务ID名称")
    @TableField(exist = false)
    private String detailBusinessIdName;

    /** 序号 */
    @Schema(description = "序号")
    private Integer detailSn;

    /** 商品ID */
    @Schema(description = "商品ID")
    @Trans(type = TransType.SIMPLE, target = SupplierProductions.class, fields = {"productionName","productionCode","productionBarcode","productionSpec","productionOrigin","productionBrand","productionUnitAuxiliary","productionUnit","productionPriceProcure","productionPriceSale","productionPriceWhole","productionPriceLimit","productionPriceRetail","productionStock"}, alias = "productions", refs = {"productionName","productionCode","productionBarcode","productionSpec","productionOrigin","productionBrand","productionUnitAuxiliary","productionUnit","productionPriceProcure","productionPriceSale","productionPriceWhole","productionPriceLimit","productionPriceRetail","productionStock"})
    private String detailProductionId;

     /**商品ID名称 */
    @Schema(description = "商品名称")
    @TableField(exist = false)
    private String productionName;

    /**商品编码 */
    @Schema(description = "商品编码")
    @TableField(exist = false)
    private String productionCode;

    /**商品条码 */
    @Schema(description = "商品条码")
    @TableField(exist = false)
    private String productionBarcode;

    /**规格 */
    @Schema(description = "规格")
    @TableField(exist = false)
    private String productionSpec;

    /**产地 */
    @Schema(description = "产地")
    @TableField(exist = false)
    private String productionOrigin;

    /**品牌 */
    @Schema(description = "品牌")
    @TableField(exist = false)
    private String productionBrand;

    /**辅助单位 */
    @Schema(description = "辅助单位")
    @TableField(exist = false)
    private String productionUnitAuxiliary;

    /**产品单位 */
    @Schema(description = "产品单位")
    @TableField(exist = false)
    private String productionUnit;

    /** 采购单价 */
    @Schema(description = "采购单价")
    @TableField(exist = false)
    private BigDecimal productionPriceProcure;

    /** 销售单价 */
    @Schema(description = "销售单价")
    @TableField(exist = false)
    private BigDecimal productionPriceSale;

    /** 批发单价 */
    @Schema(description = "批发单价")
    @TableField(exist = false)
    private BigDecimal productionPriceWhole;

    /** 最低销售单价 */
    @Schema(description = "最低销售单价")
    @TableField(exist = false)
    private BigDecimal productionPriceLimit;

    /** 零售价 */
    @Schema(description = "零售价")
    @TableField(exist = false)
    private BigDecimal productionPriceRetail;

    /** 库存 */
    @Schema(description = "库存")
    @TableField(exist = false)
    private BigDecimal productionStock;

    /**批次 */
    @Schema(description = "批次")
    private String detailProductionBatch;

    /** 出库仓库 */
    @Schema(description = "出库仓库")
    @Trans(type = TransType.SIMPLE, target = SupplierStorages.class, fields = "storeName", alias = "storages", ref = "detailShippingStorageName")
    private String detailShippingStorage;

    /**出库仓库名称 */
    @Schema(description = "出库仓库名称")
    @TableField(exist = false)
    private String detailShippingStorageName;

    /** 出库库位 */
    @Schema(description = "出库库位")
    @Trans(type = TransType.SIMPLE, target = SupplierStoresLocation.class, fields = "locationName", alias = "location", ref = "detailShippingLocationName")
    private String detailShippingLocation;

    /**出库库位名称 */
    @Schema(description = "出库库位名称")
    @TableField(exist = false)
    private String detailShippingLocationName;

    /** 入库仓库 */
    @Schema(description = "入库仓库")
    @Trans(type = TransType.SIMPLE, target = SupplierStorages.class, fields = "storeName", alias = "storages", ref = "detailStorageStorageName")
    private String detailStorageStorage;

     /**入库仓库名称 */
    @Schema(description = "入库仓库名称")
    @TableField(exist = false)
    private String detailStorageStorageName;

    /** 出库库位 */
    @Schema(description = "入库库位")
    @Trans(type = TransType.SIMPLE, target = SupplierStoresLocation.class, fields = "locationName", alias = "location", ref = "detailStorageLocationName")
    private String detailStorageLocation;

    /**出库库位名称 */
    @Schema(description = "入库库位名称")
    @TableField(exist = false)
    private String detailStorageLocationName;

    /** 数量 */
    @Schema(description = "数量")
    private BigDecimal detailNumber;

    /** 赠送数量 */
    @Schema(description = "赠送数量")
    private BigDecimal detailNumberGift;

    /** 合计数量 */
    @Schema(description = "合计数量")
    private BigDecimal detailNumberTotal;

    /** 生产日期 */
    @Schema(description = "生产日期")
    private Date detailDateManufacture;

    /** 单位 */
    @Schema(description = "单位")
    private String detailUnit;

    /** 单价 */
    @Schema(description = "单价")
    private BigDecimal detailPrice;

    /** 金额 */
    @Schema(description = "金额")
    private BigDecimal detailAmount;

    /** 辅助单位数量 */
    @Schema(description = "辅助单位数量")
    private String detailNumberAuxiliary;

    /** 备注 */
    @Schema(description = "备注")
    private String detailRemark;

    /** 业务状态 */
    @Schema(description = "业务状态")
    private String detailStatus;

    /** 扩展信息 */
    @Schema(description = "扩展信息")
    private String extJson;

    /** 数据归属 */
    @Schema(description = "数据归属")
    private String companyId;

}
